<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>输入管理员密钥</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }

        .container {
            width: 40%;
            margin: 50px auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        h2 {
            text-align: center;
            margin-bottom: 20px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .form-group input {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .form-group input:focus {
            border-color: #4CAF50;
            outline: none;
        }

        .submit-btn {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }

        .submit-btn:hover {
            background-color: #45a049;
        }

        .message {
            font-size: 16px;
            font-weight: bold;
            margin-top: 20px;
        }

        .message.success {
            color: green;
        }

        .message.error {
            color: red;
        }
    </style>
</head>
<body>

<div class="container">
    <h2>请输入管理员密钥</h2>

    <form action="./adminKeyVerificationServlet" method="post">
        <div class="form-group">
            <label for="adminKey">管理员密钥</label>
            <input type="password" id="adminKey" name="adminKey" required placeholder="请输入管理员密钥" />
        </div>

        <button type="submit" class="submit-btn">提交</button>
    </form>

    <%
        String successMessage = request.getParameter("success");
        String errorMessage = request.getParameter("error");
    %>
    <div class="message">
        <% if (successMessage != null) { %>
        <p class="success"><%= successMessage %></p>
        <% } %>
        <% if (errorMessage != null) { %>
        <p class="error"><%= errorMessage %></p>
        <% } %>
    </div>
</div>

</body>
</html>
